﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace AppToolkit.WPF.Tests.UI.Converters
{
    /// <summary>
    /// Interaction logic for EnumToImageResourceConverterUI.xaml
    /// </summary>
    public partial class EnumToImageResourceConverterUI : UserControl, INotifyPropertyChanged
    {
        Collection<TestEnum> _enumValues = new Collection<TestEnum>();

        public EnumToImageResourceConverterUI()
        {
            InitializeComponent();

            _enumValues.Add(TestEnum.Value1);
            _enumValues.Add(TestEnum.Value2);
            _enumValues.Add(TestEnum.Value3);
            ImageType = CollectionViewSource.GetDefaultView(_enumValues);

            this.DataContext = this;
        }

        public ICollectionView ImageType { get; private set; }

        #region INotifyPropertyChanged Members
        protected void OnPropertyChanged(string propertyName)
        {
            if (null != PropertyChanged)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        #endregion
    }


    public enum TestEnum
    {
        Value1,
        Value2,
        Value3,
    }
}
